Special Boolean Expressions

Three additional facilities are enabled using the method/property syntax in the If and the While commands. One is by using an in comparator for multi-select list objects, and two more by adding a suffix to the attribute name - either promptFor or isEmpty. See the section Additional properties accessible via code.

in

Syntax: @If variable in list_attribute

example: @If 'Red' in List_of_Colors

where List_of_Colors is a multi-select list object.

The in comparator can be used to check for the appearance of a given value in the current set of selected values of a list attribute. Note that the test is for the presence of the given variable within the selected set.

isEmpty

Syntax: @If attribute.isEmpty

example: @If Grade.isEmpty

where Grade is a list attribute.

This will test the evaluation status of the named attribute, returning TRUE if the attribute has not yet been obtained by inference (that is, where it is in the default 'Unassigned status'), or FALSE if the attribute has a value. Note that you cannot achieve this by testing if Grade is null, because null is not the same status that inference understands to be 'value not yet known'. Similarly, zero is not the same for a numeric attribute as 'value not yet known'. See also the topic on Static and Dynamic objects.

IsEmpty can be very useful to trap 'Unassigned status' objects within your @commands, which would normally result in a run time error message. See also the Knowledge Module Information property RaiseUnassignedErrors.

promptFor

Syntax: @If attribute.promptFor

example: @If Grade.promptFor

This will test if the named attribute has obtained a value through inference, but the current status is also set to be evaluated again by inference. Typically, this will be the situation with an attribute whose isDynamic property is set to true, or where the Evaluate command has just been used.